
<?php include_once(dirname(__FILE__) . '/../general/head.php'); ?>

<!-- header -->
<?php include_once(dirname(__FILE__) . '/../general/header.php'); ?>

<?php include_once('left.php'); ?>


<div id="page-wrapper">

    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Các bài test</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    Danh sách
                </div>
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover sb-table">
                            <thead>
                                <tr>
                                    <th>Id</th>
                                    <th>Tên bài test</th>
                                    <th>Bắt đầu</th>
                                    <th>Hết hạn làm bài</th>
                                    <th>Thời gian làm bài</th>
                                    <th>&nbsp;</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                if ($result == false) {
                                    ?>
                                    <tr>
                                        <td colspan="5">
                                            No record found!
                                        </td>
                                    </tr>
                                    <?php
                                } else {
                                    foreach ($result as $row) {
                                        ?>
                                        <tr>
                                            <td><?php echo $row->quid; ?></td>
                                            <td><?php echo $row->quiz_name; ?></td>
                                            <td><?php echo date('Y/m/d', $row->start_time); ?></td>
                                            <td><?php echo date('Y/m/d', $row->end_time); ?></td>
                                            <td><?php echo $row->duration; ?> Min. </td><td>
                                                <a href="<?php echo site_url(get_folder($loggedUser['title']).'/quizzes/attempt/' . $row->quid); ?>">Làm bài</a>
                                            </td>
                                        </tr>

                                        <?php
                                    }
                                }
                                ?>

                            </tbody>
                        </table>
<!--                        <br>
                        <a href="<?php echo site_url(get_folder($loggedUser['title']).'/quizzes/add_new'); ?>"> <img src="<?php echo base_url(); ?>images/plus.png" title="Thêm bài test mới"> Thêm bài test mới</a>-->
                    </div>

                </div>
                <!-- /.panel-body -->
            </div>
        </div>
    </div>

</div>
<!-- /#page-wrapper -->

<?php include_once(dirname(__FILE__) . '/../general/footer.php'); ?>